//版本 C++ 98 
//版本 C++ 98 

#ifndef PK_HERO_SYS
#define PK_HERO_SYS

#include<string>
#include<vector>
#include<sstream>
#include<iterator>
#include<algorithm>

using std::string;
using std::vector;
using std::stringstream;
using std::iterator;
using std::remove;

/*
    硬属性记录，和软属性记录的不同和区别，
	硬属性记录，只能用于当前攻击，防御，或者当前累加，
	攻击防御都只能应用于当前一次，
	若有累加，那么属性就会跟着累加的消泯而消泯，
	并且若有硬属性记录，软属性皆不动用，
	并且只有小王，能直接铭刻硬属性； 
	
	出牌中有小王，一切强行铭刻为硬属性，出牌中有大王，一切铭刻为软属性，并累加回合；
	
	没有大小王，则软归软硬归硬；
	
	并，软属性记录，所有归于软属性的记录，在当前回合，会软性加兼于以前的记录，
	如果有流盘，还可以叠加到后面回合； 
*/

bool lr_jZhou_jsdeng = false;   // 标记 禁咒是否被发动; 

enum s_Har {Byi = 1, Rui = 2, Dui = 3};

template<s_Har t>
struct sHar_inDer{
//	const s_Har sp_tty;
	int gGong,fFag,ndOng; 
	s_Har get_sHar(){
		return t;
	}
};
sHar_inDer<Byi> b_Har = {0,0,1};
sHar_inDer<Rui> r_Har = {1,0,0};
sHar_inDer<Dui> d_Har = {0,1,0};

int ByiRD_UpDate(s_Har sh){
	switch(sh){
		case (Byi):
			b_Har.ndOng = 1;
			b_Har.gGong = 0;
			b_Har.fFag = 0; 
			break;
		case (Rui):
			r_Har.ndOng = 0;
			r_Har.gGong = 1;
			r_Har.fFag = 0;
			break;
		case (Dui):
			d_Har.ndOng = 0;
			d_Har.gGong = 0;
			d_Har.fFag = 1;
			break;
		default:
			break;
	}
	return int(sh);
}


sHar_inDer<Byi> b_Har1_jZhong = {0,0,0};
sHar_inDer<Rui> r_Har1_jZhong = {0,0,0};
sHar_inDer<Dui> d_Har1_jZhong = {0,0,0};

int jZhong_UpDate(s_Har sh){
	switch(sh){
		case (Byi):
			b_Har1_jZhong.ndOng = 0;
			b_Har1_jZhong.gGong = 0;
			b_Har1_jZhong.fFag = 0; 
			break;
		case (Rui):
			r_Har1_jZhong.ndOng = 0;
			r_Har1_jZhong.gGong = 0;
			r_Har1_jZhong.fFag = 0;
			break;
		case (Dui):
			d_Har1_jZhong.ndOng = 0;
			d_Har1_jZhong.gGong = 0;
			d_Har1_jZhong.fFag = 0;
			break;
		default:
			break;
	}
	return int(sh);
}

template<int i_1,int i_2,int i_3>
class z_Yryer {
	protected:
		int gong, fan, n_dong;
	public:
		z_Yryer():gong(i_1),fan(i_2),n_dong(i_3){}
		
		int get_g() const{
			return gong;
		}
		int get_f() const{
			return fan;
		}
		int get_nd() const{
			return n_dong;
		}
}; 

template<>
class z_Yryer<3, 2, 1> {
protected:
    // 特化版本可以有不同的成员变量（根据需求调整）
    int gong, fan, n_dong;
    string extra_value; // 特化版本新增的成员（示例）
public:
    // 特化版本的构造函数（可以自定义逻辑）
    z_Yryer() : gong(3), fan(2), n_dong(1), extra_value("骑士") {}
    
    // 可以重写成员函数（也可以保持与通用版本一致）
    int get_g() const{ 
        return gong; // 特化逻辑：返回2倍的gong
    }
    
    int get_f() const{ 
        return fan; // 保持与通用版本一致
    }
    
    int get_nd() const{ 
        return n_dong; // 使用特化版本新增的成员
    }
    
    // 特化版本可以新增函数
    string get_extra()const {
        return extra_value;
    }
};

template<>
class z_Yryer<3, 1, 2> {
protected:
    // 特化版本可以有不同的成员变量（根据需求调整）
    int gong, fan, n_dong;
    string extra_value; // 特化版本新增的成员（示例）
public:
    // 特化版本的构造函数（可以自定义逻辑）
    z_Yryer() : gong(3), fan(1), n_dong(2), extra_value("战士") {}
    
    // 可以重写成员函数（也可以保持与通用版本一致）
    int get_g() const { 
        return gong; // 特化逻辑：返回2倍的gong
    }
    
    int get_f() const { 
        return fan; // 保持与通用版本一致
    }
    
    int get_nd() const { 
        return n_dong; // 使用特化版本新增的成员
    }
    
    // 特化版本可以新增函数
    string get_extra() const {
        return extra_value;
    }
};


template<>
class z_Yryer<2, 3, 1> {
protected:
    // 特化版本可以有不同的成员变量（根据需求调整）
    int gong, fan, n_dong;
    string extra_value; // 特化版本新增的成员（示例）
public:
    // 特化版本的构造函数（可以自定义逻辑）
    z_Yryer() : gong(2), fan(3), n_dong(1), extra_value("盾卫") {}
    
    // 可以重写成员函数（也可以保持与通用版本一致）
    int get_g() const { 
        return gong; // 特化逻辑：返回2倍的gong
    }
    
    int get_f() const { 
        return fan; // 保持与通用版本一致
    }
    
    int get_nd() const { 
        return n_dong; // 使用特化版本新增的成员
    }
    
    // 特化版本可以新增函数
    string get_extra() const {
        return extra_value;
    }
};

typedef z_Yryer<3, 2, 1> s_QIshi_obj;
typedef z_Yryer<3, 1, 2> s_ZHangShi_obj;
typedef z_Yryer<2, 3, 1> s_dUnWei_obj;


template<typename T> 
class zHero_dby {
	protected:
		//z_Yryer<T>
		T s_zYeyr;   //  s_QIshi_obj, s_ZHangShi_obj, s_dUnWei_obj
		s_Har sh;
	public:
		zHero_dby(const zHero_dby<T>& zhdby):s_zYeyr(zhdby.s_zYeyr),sh(zhdby.sh){} 
	    zHero_dby(T t,s_Har s):s_zYeyr(t),sh(s){}
		
		vector<int> get_HeroNliyr() const{
			// s_QIshi_obj
			int i[3]={s_zYeyr.get_g(),s_zYeyr.get_f(),s_zYeyr.get_nd()};
			return vector<int>(i,i+3);
		}
		const string get_extra_hero()const{
			return s_zYeyr.get_extra();
		}  
		s_Har get_sHar()const{
			return sh;
		} 
};


enum x_sHurruir {i_r='r',iFk='F',iHx='X',eMh='M',eHk='H',e_y='y'};
enum p_nKarZirter {_1__=1,_2__=2,_3__=3,_4__=4,_5__=5,_6__=6,_7__=7,_8__=8,_9__=9,_0__=10,
    _J__=11,_Q__=12,_K__=13,_w__=14,_W__=15};
//_0__ = 10 ;
//w = 小王，W = 大王 ; 

class k_nKar {
	protected:
		x_sHurruir s_Px;
		p_nKarZirter n_kz;
	public:
		// 修正1：拷贝构造函数参数改为const引用
		k_nKar(const k_nKar& i){
			s_Px = i.get_Px();
			n_kz = i.get_kz();
		}
		k_nKar(p_nKarZirter p,x_sHurruir x):s_Px(x),n_kz(p){}
		
		// 修正3：getter函数声明为const（确保const对象可调用）
		x_sHurruir get_Px() const {
			return s_Px;
		}
		p_nKarZirter get_kz() const {
			return n_kz;
		} 
		
		friend bool operator==(const k_nKar& lhs, const k_nKar& rhs);
		
		string get_karNerotor(){
			int zk_num = int(n_kz);
			stringstream ss;
			ss << '#' << zk_num << '-' << char(s_Px);
			string m_str = ss.str();
			return m_str;
		} 
}n_quan54_pai[54]={
	k_nKar(_1__,iFk),k_nKar(_1__,iHx),k_nKar(_1__,eMh),k_nKar(_1__,eHk),
	k_nKar(_2__,iFk),k_nKar(_2__,iHx),k_nKar(_2__,eMh),k_nKar(_2__,eHk),
	k_nKar(_3__,iFk),k_nKar(_3__,iHx),k_nKar(_3__,eMh),k_nKar(_3__,eHk),
	k_nKar(_4__,iFk),k_nKar(_4__,iHx),k_nKar(_4__,eMh),k_nKar(_4__,eHk),
	k_nKar(_5__,iFk),k_nKar(_5__,iHx),k_nKar(_5__,eMh),k_nKar(_5__,eHk),
	k_nKar(_6__,iFk),k_nKar(_6__,iHx),k_nKar(_6__,eMh),k_nKar(_6__,eHk),
	k_nKar(_7__,iFk),k_nKar(_7__,iHx),k_nKar(_7__,eMh),k_nKar(_7__,eHk),
	k_nKar(_8__,iFk),k_nKar(_8__,iHx),k_nKar(_8__,eMh),k_nKar(_8__,eHk),
	k_nKar(_9__,iFk),k_nKar(_9__,iHx),k_nKar(_9__,eMh),k_nKar(_9__,eHk),
	k_nKar(_0__,iFk),k_nKar(_0__,iHx),k_nKar(_0__,eMh),k_nKar(_0__,eHk),
	k_nKar(_J__,iFk),k_nKar(_J__,iHx),k_nKar(_J__,eMh),k_nKar(_J__,eHk),
	k_nKar(_Q__,iFk),k_nKar(_Q__,iHx),k_nKar(_Q__,eMh),k_nKar(_Q__,eHk),
	k_nKar(_K__,iFk),k_nKar(_K__,iHx),k_nKar(_K__,eMh),k_nKar(_K__,eHk),
	k_nKar(_W__,i_r),k_nKar(_w__,e_y)
};

// 在类外部实现==运算符重载
bool operator==(const k_nKar& lhs, const k_nKar& rhs) {
    // 根据实际业务逻辑判断相等条件
    // 示例：当ID、名称、力量值和类型都相同时，认为两个卡牌相等
	//	x_sHurruir s_Px;
	//	p_nKarZirter n_kz;
    return (lhs.s_Px == rhs.s_Px) &&
           (lhs.n_kz == rhs.n_kz);
}

template<int t_Pkz>
class n_Soupai_kz{
	protected:
		int k_nSum;
		bool is_QuIN;
		// 修正2：用vector替代数组，避免需要默认构造函数
		vector<k_nKar> sp_z;
	public:
		n_Soupai_kz():k_nSum(t_Pkz),is_QuIN(false){}
		// 构造函数调整为初始化vector
		n_Soupai_kz(k_nKar it[t_Pkz]):k_nSum(t_Pkz),is_QuIN(true){
		    for(int i=0;i<t_Pkz;i++){
		    	sp_z.push_back(it[i]); // 调用拷贝构造函数，无需默认构造
			}	
		}
		vector<k_nKar> get_Soupai_kz(){
			if(is_QuIN) return sp_z;
			return vector<k_nKar>(); 
		}
		
		vector<k_nKar> set_Now_mShoupai(vector<k_nKar> n){
			if(is_QuIN==false)is_QuIN = true;
			sp_z = n;
			k_nSum = sp_z.size();
			return sp_z;
		}
		
		int get_nSum(){
			return k_nSum;
		}
		// 游戏功能设计（略）
		/* 手札功能区 */
};

n_Soupai_kz<54> nQuan54_pai(n_quan54_pai);
//以下技能区； 

template<typename t_Tyir, int n>
struct get_nPoker_impl;

template<typename t_Tyir>
class zhi_Ye__{
	protected:
		zHero_dby<t_Tyir> _zhiYeir__;  //
	public:
		zhi_Ye__(zHero_dby<t_Tyir> t):_zhiYeir__(t){}
	    zhi_Ye__(s_Har sh):_zhiYeir__(t_Tyir(),sh){} 
	
	const zHero_dby<t_Tyir>& get_zhiYeir__() const {
		return this->_zhiYeir__;
	}
	template<int n>
    int get_nPoker(n_Soupai_kz<n> zvr) {
    	n_Soupai_kz<n> z_Vr(zvr); 
        return get_nPoker_impl<t_Tyir, n>::calc(*this,z_Vr);
    }
};

template<typename t_Tyir, int n>
struct get_nPoker_impl {
    static int calc(zhi_Ye__<t_Tyir>& z, n_Soupai_kz<n>& k) {
        // 实现具体逻辑
        return 0;
    }
};

enum oPor_xl {
	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
};
enum oPor_ry {
	m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
	m_XinSr, m_CumLyior                //现杀, 存流 
};

class z_XuLie_oPor{    //状态类 
	protected: 
		oPor_xl _e_Mole__;           //状态影响类型 
		unsigned int n_Mum;          //状态影响效能
		unsigned int n_Mum_huih;     //状态影响回合数
		oPor_ry m_Ry;                //影响态性
	public:
		z_XuLie_oPor():_e_Mole__(nNull),n_Mum(0),n_Mum_huih(0),m_Ry(m_Wuyr){} 
		z_XuLie_oPor(const z_XuLie_oPor& x_xlpr){
			this->_e_Mole__ = x_xlpr.get_eZtlx();
			this->n_Mum = x_xlpr.get_nMum();
			this->n_Mum_huih = x_xlpr.get_nMumHuih();
			this->m_Ry = x_xlpr.get_mRuanying();
		}
	    z_XuLie_oPor(oPor_xl const e, unsigned int const nM, unsigned int const n_Mhu, oPor_ry const m_ry):
		    _e_Mole__(e), n_Mum(nM), n_Mum_huih(n_Mhu), m_Ry(m_ry) {
			}
		
		// 所有getter函数都添加const修饰符
		oPor_xl get_eZtlx() const {
			return _e_Mole__;
		} 
		unsigned int get_nMum() const {
			return n_Mum;
		}
		unsigned int get_nMumHuih() const {
			return n_Mum_huih;
		}
		unsigned int set_nMum(unsigned int nM) {
			n_Mum = nM; 
			return n_Mum;
		}
		unsigned int set_nMumHuih(unsigned int nM_hui) {
			n_Mum_huih = nM_hui;
			return n_Mum_huih;
		}
		oPor_ry get_mRuanying() const {
			return m_Ry;
		}
}; 

struct z_xPor_list {
    z_XuLie_oPor* z_xopor;
    z_xPor_list* ptr_next;  // 修正拼写错误，保持与结构体名称一致
    z_xPor_list* ptr_lof;
    // 添加构造函数，显式初始化成员
    z_xPor_list(z_XuLie_oPor* z, z_xPor_list* ptr_z = NULL)  // 使用NULL兼容旧编译器
        : z_xopor(z), ptr_next(ptr_z), ptr_lof(NULL) {}  // 修正成员名拼写
    
//    ~z_xPor_list(){
//    	if(z_xopor){
//		    delete z_xopor;	
//		}
//		if(ptr_lof != NULL){  // 仅当ptr_lof有效时修改
//		    ptr_lof->ptr_next = ptr_next;
//		}
//	}
    ~z_xPor_list(){
        if(z_xopor != NULL){
            delete z_xopor;
            z_xopor = NULL; // 避免野指针
        }
        // 仅当前驱和后继都非空时，更新链表
        if(ptr_lof != NULL && ptr_next != NULL){
            ptr_lof->ptr_next = ptr_next;
            ptr_next->ptr_lof = ptr_lof; // 双向链表同步更新
        }
        // 若为尾节点，前驱的next置空
        else if(ptr_lof != NULL && ptr_next == NULL){
            ptr_lof->ptr_next = NULL;
        }
        // 清空指针，避免悬空
        ptr_lof = NULL;
        ptr_next = NULL;
    }
}; 

template<s_Har sh> 
class zTai_list{
protected:
    z_xPor_list* zp_lis_top;    //首位 
    z_xPor_list* z_sj;     //滑轮 
    
    unsigned int n_zuiDie_hs;
public:
	zTai_list():z_sj(NULL),zp_lis_top(NULL),n_zuiDie_hs(0){} 
    zTai_list(z_xPor_list* p_lis):zp_lis_top(p_lis),n_zuiDie_hs(0){
    	z_sj = zp_lis_top;
    	if (z_sj != NULL) {
        for(; z_sj->ptr_next != NULL; ) {
            z_sj = z_sj->ptr_next;
			}
		}
	} 
    
    // 使用NULL代替nullptr以兼容C++03
    zTai_list(z_XuLie_oPor *z)          //, z_xPor_list* ptr_z = NULL
        :zp_lis_top(new z_xPor_list(z, NULL)),n_zuiDie_hs(0){
        /*
		z_sj = zp_lis_top;
        if (z_sj != NULL) {  // 增加非空判断
		for(; z_sj->ptr_next != NULL; ) {
		    z_sj = z_sj->ptr_next;
			}
		}
		*/
		z_sj = zp_lis_top->ptr_next;
	}
	
	unsigned int get_Object_mNum(){
		unsigned int i = 0;
		z_xPor_list *dlz = this->get_lisTop_ptr();
		while(dlz != NULL){
			dlz = dlz->ptr_next;
			i ++; 
		}
		return i;
	}
	
	z_xPor_list* get_lisTop_ptr(){
		return zp_lis_top;
	}
	
	zTai_list* set_puth(z_xPor_list *zlis_puth){
		z_xPor_list *dl; 
		if (z_sj == NULL) {
            // 链表为空时的处理（如直接指向新节点）
            if(zp_lis_top!=NULL){
            	z_sj = zp_lis_top;
			} 
			else {
				zp_lis_top = zlis_puth;
				z_sj = zlis_puth;
				return this;
			}
		}
		while(z_sj->ptr_next != NULL){    //  滑轮滑倒最尾； 
			dl = z_sj;
			z_sj = z_sj->ptr_next;
			if(z_sj->ptr_lof == NULL)
			    z_sj->ptr_lof = dl;
		}
		z_sj->ptr_next = zlis_puth;
		zlis_puth->ptr_lof = z_sj; 
		z_sj = z_sj->ptr_next;
		for(;z_sj->ptr_next!=NULL;){
			dl = z_sj;
			if(z_sj->ptr_next!=NULL){
			    z_sj = z_sj->ptr_next;
			    if(z_sj->ptr_lof == NULL) z_sj->ptr_lof = dl;
			}
        }
		return this;
	}
	
	s_Har get_sHarStyle(){
		return sh;
	}
	
	//sHar_inDer<Byi> b_Har1_jZhong = {0,0,0};
	//sHar_inDer<Rui> r_Har1_jZhong = {0,0,0};
	//sHar_inDer<Dui> d_Har1_jZhong = {0,0,0};

    //  int jZhong_UpDate(s_Har sh)
	
	
    //oPor_xl
	//nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
    //oPor_ry
	//m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
	//m_XinSr, m_CumLyior                //现杀, 存流 
	
	unsigned int nPort_chormNow_Sayler_mYing(){
	    z_xPor_list *zsj; 
	    s_Har s_hr = this->get_sHarStyle();
	    unsigned int n_Get_null = 0;
	    switch (s_hr){
	    	case (Byi):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				} 
			    break;
	    	case (Rui):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				}
			    break;
	    	case (Dui):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Yimg){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				}
			    break;
			default:
			    break; 
		}
		n_zuiDie_hs = n_Get_null;
		return n_Get_null;	
	}

	unsigned int nPort_chormNow_Sayler(){     //分析 状态链;
	    z_xPor_list *zsj; 
	    s_Har s_hr = this->get_sHarStyle();
	    unsigned int n_Get_null = 0;
	    switch (s_hr){
	    	case (Byi):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har1_jZhong.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har1_jZhong.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    b_Har1_jZhong.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				} 
			    break;
	    	case (Rui):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har1_jZhong.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har1_jZhong.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    r_Har1_jZhong.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				}
			    break;
	    	case (Dui):
	    		zsj = this->get_lisTop_ptr();
	    		while (zsj!=NULL){
	    			//zsj->z_xopor->get_eZtlx() 
	    			switch (zsj->z_xopor->get_eZtlx()){
	    				case (nGongJ):
	    					if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har1_jZhong.gGong += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nFanYu):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har1_jZhong.fFag += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNenDng):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    d_Har1_jZhong.ndOng += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						case (nNull):
							if (zsj->z_xopor->get_mRuanying() == m_Ruam){
	    						if(zsj->z_xopor->get_nMumHuih() > 0){
								    n_Get_null += 
								        zsj->z_xopor->get_nMum();
								    //  zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
							    }
							}
							zsj = zsj->ptr_next;
						    break;
						default:
							break;
					} 
				}
			    break;
			default:
			    break; 
		}
		n_zuiDie_hs = n_Get_null;
		return n_Get_null;
	}
	unsigned int get_chorimNow_Game(oPor_xl xl,bool sf_quyong=false){  //提取状态因素; 
	    // 先处理硬性内容, 没有硬性状态才开始动用软性; nNull性素通用  ;
	    unsigned int g_mNum = 0;
	    switch (xl){
	    	//  nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
	    	case (nGongJ):
	    		switch (this->get_sHarStyle()){
	    			case (Byi):
	    				//b_Har1_jZhong
	    				g_mNum = b_Har1_jZhong.gGong + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Rui):
	    				//r_Har1_jZhong
	    				g_mNum = r_Har1_jZhong.gGong + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Dui):
	    				//d_Har1_jZhong
	    				g_mNum = d_Har1_jZhong.gGong + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break; 
	    			default:
	    				break;
				}
	    		break;
	    	case (nFanYu):
	    		switch (this->get_sHarStyle()){
	    			case (Byi):
	    				//b_Har1_jZhong
	    				g_mNum = b_Har1_jZhong.fFag + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Rui):
	    				//r_Har1_jZhong
	    				g_mNum = r_Har1_jZhong.fFag + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Dui):
	    				//d_Har1_jZhong
	    				g_mNum = d_Har1_jZhong.fFag + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break; 
	    			default:
	    				break;
				}
	    		break;
	    	case (nNenDng):
	    		switch (this->get_sHarStyle()){
	    			case (Byi):
	    				//b_Har1_jZhong
	    				g_mNum = b_Har1_jZhong.ndOng + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Rui):
	    				//r_Har1_jZhong
	    				g_mNum = r_Har1_jZhong.ndOng + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break;
					case (Dui):
	    				//d_Har1_jZhong
	    				g_mNum = d_Har1_jZhong.ndOng + (sf_quyong)?n_zuiDie_hs:0;
	    				if(sf_quyong)n_zuiDie_hs = 0;
	    				return g_mNum;
	    				break; 
	    			default:
	    				break;
				}
	    		break;
	    	default:
	    		g_mNum = n_zuiDie_hs;
				n_zuiDie_hs = 0; 
	    		return g_mNum;
	    		break;
		}
		return 0; 
	}
	
//	unsigned int iPoir_Next(){  //状态流动; 
//	    z_xPor_list *zsj, *dl;
//	    zsj = this->get_lisTop_ptr();
//		while(zsj!=NULL){
//			if(zsj->z_xopor->get_nMumHuih() > 0){
//				zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih()-1); 
//			}
//			if(zsj->z_xopor->get_nMumHuih() <= 0){
//			    dl = zsj;
//			    zsj = zsj->ptr_next;
//			    delete dl;
//			    continue;
//		    }   
//		    else {
//        	    zsj = zsj->ptr_next;
//		    }
//		}
//		return 1;
//	}
/*	*/
    unsigned int iPoir_Next(){
        z_xPor_list *zsj = get_lisTop_ptr();
        z_xPor_list *prev = NULL; // 记录前驱节点
        while(zsj != NULL){
            z_xPor_list *next_node = zsj->ptr_next; // 提前保存后继（避免删除后访问）
            // 减少状态回合数
            if(zsj->z_xopor->get_nMumHuih() > 0){
                zsj->z_xopor->set_nMumHuih(zsj->z_xopor->get_nMumHuih() - 1); 
            }
            // 删除过期状态
            if(zsj->z_xopor->get_nMumHuih() <= 0){
                // 更新链表头
                if(prev == NULL){
                    zp_lis_top = next_node;
                } else {
                    prev->ptr_next = next_node;
                }
                // 更新后继节点的前驱
                if(next_node != NULL){
                    next_node->ptr_lof = prev;
                }
                // 安全删除当前节点
                delete zsj;
            } else {
                prev = zsj; // 仅未删除时更新前驱
            }
            zsj = next_node; // 使用提前保存的后继，避免访问已删除内存
        }
        return 1;
    }	
	
	~zTai_list(){
		while(zp_lis_top!=NULL){
		    z_sj = zp_lis_top;
		    zp_lis_top = z_sj->ptr_next;
		    delete z_sj;
		}
	}
}; 

//  zTai_list(z_xPor_list* p_lis)
//  new z_xPor_list(new z_XuLie_oPor(nGongJ,0,2,m_Jinz))
zTai_list<Byi> b_zTai_lis;
zTai_list<Rui> r_zTai_lis;
zTai_list<Dui> d_zTai_lis;

class nhero_base {
public:
    //virtual ~nhero_base() = default; 虚析构确保子类正确销毁
    virtual ~nhero_base() {}
};

template<typename T,int N>    //T = s_QIshi_obj,s_ZHangShi_obj,s_dUnWei_obj; 
class nhero_oopjob:public nhero_base{
	protected: 
		zHero_dby<T> n_jHero;
		n_Soupai_kz<N> nhero_poker_sp;
	public:
		typedef T HeroType;  // 添加类型别名，暴露zHero_dby的模板类型T
		// 每回合游戏会扣除一个蓄力点，不及时加深蓄力，蓄力状态会被取消。。。。。。。。 
		// 取消后蓄力归零，蓄力点不再继续扣除。。。。。。。。 
		unsigned int nM_nCorLiper;    //蓄力状态，0为没有蓄力，1为目前还有一点蓄力点，2或而以上，为多回合蓄力 
		int m_Xie_n;         //血量 
		
		nhero_oopjob(T dj,n_Soupai_kz<N> nhp,s_Har sh,unsigned int x = 7):
		    n_jHero(zHero_dby<T>(dj,sh)),nhero_poker_sp(nhp),m_Xie_n(x){
		    	nM_nCorLiper = 0;
			}
		nhero_oopjob(const nhero_oopjob& oj):
		    n_jHero(oj.n_jHero),nhero_poker_sp(oj.nhero_poker_sp),m_Xie_n(oj.m_Xie_n){
		    	nM_nCorLiper = 0;
			}
		nhero_oopjob(const nhero_oopjob* oj):
		    n_jHero(oj->n_jHero),nhero_poker_sp(oj->nhero_poker_sp),m_Xie_n(oj->m_Xie_n){
		    	nM_nCorLiper = 0;
			}
		nhero_oopjob(zHero_dby<T> dj,n_Soupai_kz<N> nhp,unsigned int x = 8):
		    n_jHero(dj),nhero_poker_sp(nhp),m_Xie_n(x){
		    	nM_nCorLiper = 0;
			}
			
		zHero_dby<T> n_jHero_Get(){
			return n_jHero;
		}
		
		n_Soupai_kz<N> get_shoupai(){
			return nhero_poker_sp;
		}
		
		nhero_oopjob set_nShoupai_Mum(vector<k_nKar> n){
			nhero_poker_sp.set_Now_mShoupai(n);
			return *this;
		}
		
		template<unsigned int n>   
		n_Soupai_kz<n>*
		    get_nChu_pai(int k[]){
		    	// k_nKar now;
		    	vector<k_nKar> vt_obj;
		    	vector<k_nKar> v_tor = this->get_shoupai().get_Soupai_kz();
		    	for(int i=0;i<n;i++){
		    		//  now = v_tor.at(k[i]);
		    		vt_obj.push_back(v_tor.at(k[i]));
				}
				if(vt_obj.size()==n){
					for(int i=0;i<n;i++){
						vector<k_nKar>::iterator last = remove(v_tor.begin(),v_tor.end(),vt_obj[i]);
						v_tor.erase(last,v_tor.end());
					}
					nhero_poker_sp.set_Now_mShoupai(v_tor);
				    return new n_Soupai_kz<n>(vt_obj.data()); 
				}
				
				return NULL;
			}   
		
		unsigned int get_sPai_Num() {
			return this->nhero_poker_sp.get_Soupai_kz().size();
		} 
};


// 让nhero_oopjob继承基类
//template<typename T,int N>    
//class nhero_oopjob : public nhero_base {  // 继承基类
//protected:
//    T n_jHero;
//    n_Soupai_kz<N> nhero_poker_sp;
//    zTai_list zt_lis;
//public:
//    nhero_oopjob(T dj, n_Soupai_kz<N> nhp) : n_jHero(dj), nhero_poker_sp(nhp) {}
//};


enum dmod_Style {_nZuam_xian___,_n_HunZhan__};
enum zUang_Jia {Ty_1= 1,Ty_2= 2,Ty_3= 3,w_Wurr= 0};

enum nShengFu_zTyi {z_Sheng = 4,x_Sheng = 0, p_One_Shen = 1, p_Two_Shen = 2, p_three_Shen = 3, w_WuSfur = 5}; 
// 在pk_hero_system.h中添加
class n_YuanZhuo_base {
public:
    virtual ~n_YuanZhuo_base() {}// 虚析构函数，确保派生类析构正确调用
    
	virtual vector<k_nKar> get_Shoupai_NowsList() = 0;
	
	//template<unsigned int N>  出的牌的下标  出牌的数量     基要对象位置 
    virtual int n_Port_setPai_Now(int nNum[], unsigned int N, s_Har sh) = 0; 
    
	//template<> m_Jinz, m_Wuyr
	virtual z_xPor_list* get_nPor_ry(oPor_ry _ry__) = 0; //  是否有特殊标记 
	
	virtual zUang_Jia get_zUang_Jia() = 0;  // 获取庄家位置; 
	virtual bool i_xPro_livNow() = 0;  // 是否存活;
	virtual bool get_isZhuang_jia() = 0;  // 是否为庄家; 
	virtual dmod_Style get_isZX_style() = 0; //  dmod_Style庄闲状态: 分庄闲，或混战； 
	// enum dmod_Style {_nZuam_xian___,_n_HunZhan__};
	virtual s_Har get_NowsHar() const = 0;
	virtual unsigned int get_nwHero_PyiLiang() = 0; // 当前手牌数量； 
	
	virtual unsigned int get_nwHero_XLiang() const = 0; // 血量 
	virtual nShengFu_zTyi get_ShengFU_zTai(dmod_Style n_sty) = 0;  // 胜负判断 
	virtual unsigned int get_Now_zTai_num() const = 0;   //  状态数量；
	
	// 输出对应位置的血量； 
	virtual unsigned int get_nheroOne_xieliang()const = 0; 
	virtual unsigned int get_nheroTwo_xieliang()const = 0;
	virtual unsigned int get_nherothree_xieliang()const = 0;
	
	virtual string get_nHero_zhiye__() const = 0; // 输出当前英雄职业； 
	
	//  virtual unsigned int next_Poker_pHar() = 0; 
	virtual n_YuanZhuo_base* next_Poker_pHar() = 0; //迭代。。。。 
};
/**/
// 1. 定义类型检查工具（判断是否为nhero_oopjob派生类）
namespace detail {
    // 辅助结构体：通过指针转换判断继承关系
    template<typename Derived, typename Base>
    struct is_derived {
        // 若Derived是Base的派生类，则Base*可以隐式转换为Derived*
        static char check(Base*);
        static long check(...); // 匹配所有不满足上面条件的类型
        enum { value = sizeof(check(static_cast<Derived*>(0))) == sizeof(char) };
    };
}

// 2. 定义C++98兼容的静态断言（利用编译期除0错误）
#define STATIC_ASSERT(expr, msg) \
    typedef char static_assert_##msg[(expr) ? 1 : -1]

// 3. 改进n_YuanZhuo模板类，添加参数约束
template<typename t1, typename t2, typename t3, dmod_Style sty = _n_HunZhan__>
class n_YuanZhuo : public n_YuanZhuo_base {
protected:
    // 编译期验证t1/t2/t3必须是nhero_oopjob的派生类
    STATIC_ASSERT((detail::is_derived<t1, nhero_base>::value), t1_must_be_derived_from_nhero_oopjob);
    STATIC_ASSERT((detail::is_derived<t2, nhero_base>::value), t2_must_be_derived_from_nhero_oopjob);
    STATIC_ASSERT((detail::is_derived<t3, nhero_base>::value), t3_must_be_derived_from_nhero_oopjob);

	protected:
		bool is_New[3];
		t1* nHero_one;
		t2* nHero_two;
		t3* nHero_three;
		zUang_Jia zuan;
		unsigned int i_nLunSum;
		unsigned int n_iHuihe_sum;
		const dmod_Style dm_sty;
	public:
		string get_nHero_zhiye__() const{
			unsigned int i = i_nLunSum%3;
			switch (i){
				case (0):
					// nhero_oopjob.n_jHero_Get().get_extra_hero()
					return this->nHero_one->n_jHero_Get().get_extra_hero();
					break;
				case (1):
					return this->nHero_two->n_jHero_Get().get_extra_hero();
					break;
				case (2):
					return this->nHero_three->n_jHero_Get().get_extra_hero();
					break;
				default:
				    break; 
			}
			return "";
		}
	    n_YuanZhuo(t1 *one,t2 *two,t3 *three,zUang_Jia z=w_Wurr):
		    nHero_one(one),nHero_two(two),nHero_three(three),zuan(z),dm_sty(sty){
		    	i_nLunSum = 0;
		    	n_iHuihe_sum = 0;
			    is_New[0] = false;
		    	is_New[1] = false;
		    	is_New[2] = false;
			}
	    n_YuanZhuo(t1 *one,t2 *two,t3 *three,n_Soupai_kz<54> n_zk,zUang_Jia z=w_Wurr):
		    nHero_one(one),nHero_two(two),nHero_three(three),zuan(z),dm_sty(sty){
		    	i_nLunSum = 0;
		    	n_iHuihe_sum = 0;
		    	
		    	is_New[0] = false;
		    	is_New[1] = false;
		    	is_New[2] = false;
				if(sty == _nZuam_xian___){
		    		if(zuan == w_Wurr)zuan = Ty_1;
		    		vector<k_nKar> n_Zk = n_zk.get_Soupai_kz(); 
		    		vector<k_nKar> k_Nkar[3];
		    		for(int i=0;i<51;i++){
		    			switch(i%3){
		    				case (0):
		    					k_Nkar[0].push_back(n_Zk[i]);
		    					break;
		    				case (1):
		    					k_Nkar[1].push_back(n_Zk[i]);
		    					break;
		    				case (2):
		    					k_Nkar[2].push_back(n_Zk[i]);
		    					break;
		    				default:
		    					break;
						}
					}
					switch(zuan) {
		    			case Ty_1:
		    				k_Nkar[0].push_back(n_Zk[51]);
		    				k_Nkar[0].push_back(n_Zk[52]);
		    				k_Nkar[0].push_back(n_Zk[53]);
							nHero_one->m_Xie_n = 9;
							nHero_two->m_Xie_n = 7;
							nHero_three->m_Xie_n = 7; 
						    break;
		    			case Ty_2:
		    				k_Nkar[1].push_back(n_Zk[51]);
		    				k_Nkar[1].push_back(n_Zk[52]);
		    				k_Nkar[1].push_back(n_Zk[53]);
							nHero_one->m_Xie_n = 7;
							nHero_two->m_Xie_n = 9;
							nHero_three->m_Xie_n = 7;
						    break;
		    			case Ty_3:
		    				k_Nkar[2].push_back(n_Zk[51]);
		    				k_Nkar[2].push_back(n_Zk[52]);
		    				k_Nkar[2].push_back(n_Zk[53]);
							nHero_one->m_Xie_n = 7;
							nHero_two->m_Xie_n = 7;
							nHero_three->m_Xie_n = 9;
						    break;
						default:
						    break; 
					}
					nHero_one->set_nShoupai_Mum(k_Nkar[0]);
					nHero_two->set_nShoupai_Mum(k_Nkar[1]);
					nHero_three->set_nShoupai_Mum(k_Nkar[2]);
				}
				if(sty == _n_HunZhan__){
		    		if(zuan != w_Wurr)zuan = w_Wurr;
		    		vector<k_nKar> n_Zk = n_zk.get_Soupai_kz(); 
		    		vector<k_nKar> k_Nkar[3];
		    		for(int i=0;i<54;i++){
		    			switch(i%3){
		    				case (0):
		    					k_Nkar[0].push_back(n_Zk[i]);
		    					break;
		    				case (1):
		    					k_Nkar[1].push_back(n_Zk[i]);
		    					break;
		    				case (2):
		    					k_Nkar[2].push_back(n_Zk[i]);
		    					break;
		    				default:
		    					break;
						}
					}
					nHero_one->set_nShoupai_Mum(k_Nkar[0]);
					nHero_two->set_nShoupai_Mum(k_Nkar[1]);
					nHero_three->set_nShoupai_Mum(k_Nkar[2]);
				}
				return;
			}
			
		
	    unsigned int get_nheroOne_xieliang()const{
	    	return this->nHero_one->m_Xie_n; 
		}
	    unsigned int get_nheroTwo_xieliang()const{
	    	return this->nHero_two->m_Xie_n; 
		}
	    unsigned int get_nherothree_xieliang()const{
	    	return this->nHero_three->m_Xie_n; 
		}
	    
		unsigned int get_nwHero_XLiang() const{
			int n = 0;
			unsigned int i = this->i_nLunSum%3;
			switch (i){
				case (0):  
				// nhero_oopjob.m_Xie_n
					n = nHero_one->m_Xie_n;
					break;
				case (1):
					n = nHero_two->m_Xie_n;
					break;
				case (2):
					n = nHero_three->m_Xie_n;
					break;
				default:
					break;
			}
			return n;
		}
		
		unsigned int get_Now_zTai_num() const{
			int n = 0;
			unsigned int i = this->i_nLunSum%3;
			switch (i){
				case (0):
					n = b_zTai_lis.get_Object_mNum();
					break;
				case (1):
					n = r_zTai_lis.get_Object_mNum();
					break;
				case (2):
					n = d_zTai_lis.get_Object_mNum();
					break;
				default:
					break;
			}
			return n;
		}	
		
		nShengFu_zTyi get_ShengFU_zTai(dmod_Style n_sty){
		    //  enum dmod_Style {_nZuam_xian___,_n_HunZhan__};
            // enum nShengFu_zTyi {z_Sheng = 4,x_Sheng = 0, p_One_Shen = 1, p_Two_Shen = 2, p_three_Shen = 3, w_WuSfur = 5}; 
            switch (n_sty){
            	case (_nZuam_xian___):
            		switch (this->zuan){
            			case (Byi):
            				if (this->nHero_one == NULL)return x_Sheng;
            				else{
            					if(this->nHero_two == NULL && this->nHero_three == NULL){
            						return z_Sheng;
								}
							}
            				break;
            			case (Rui):
            				if (this->nHero_two == NULL)return x_Sheng;
            				else{
            					if(this->nHero_one == NULL && this->nHero_three == NULL){
            						return z_Sheng;
								}
							}
            				break;
            			case (Dui):
            				if (this->nHero_three == NULL)return x_Sheng;
            				else{
            					if(this->nHero_one == NULL && this->nHero_two == NULL){
            						return z_Sheng;
								}
							}
            				break;
					}
            		break;
            	case (_n_HunZhan__):
            		if (nHero_one != NULL){
            			if(this->nHero_two == NULL && this->nHero_three == NULL)return p_One_Shen; 
					}
            		if (nHero_two != NULL){
            			if(this->nHero_one == NULL && this->nHero_three == NULL)return p_Two_Shen; 
					}
            		if (nHero_three != NULL){
            			if(this->nHero_two == NULL && this->nHero_one == NULL)return p_three_Shen; 
					}
            		break;
            	default:
            		break;
			} 
			return w_WuSfur; //胜负未定； 
		}
		
		vector<k_nKar> get_Shoupai_NowsList(){
			//  this->nHero_one
			vector<k_nKar> ret;
			switch (this->i_nLunSum%3){
			    case (0):
			    	//  nhero_oopjob.get_shoupai();
			    	ret = this->nHero_one->get_shoupai().get_Soupai_kz();
			    	break;
			    case (1):
			    	ret = this->nHero_two->get_shoupai().get_Soupai_kz();
			    	break;
			    case (2):
			    	ret = this->nHero_three->get_shoupai().get_Soupai_kz();
			    	break;
			    default:
			    	break;
			}
			return ret;
		}
		s_Har get_NowsHar()const {
			s_Har sh;
		    unsigned int i = this->i_nLunSum%3;
		    switch (i){
		    	case (0):
		    		sh = Byi;
		    		break;
		    	case (1):
		    		sh = Rui;
		    		break;
		    	case (2):
		    		sh = Dui;
		    		break;
		    	default:
		    		break;
			}
			return sh; 
		}
		
		int n_Port_setPai_Now(int nNum[], unsigned int N, s_Har sh) {
        // 根据数组大小N，调用对应的模板版本
		    switch (N) {
                case 1:
				    switch (this->i_nLunSum%3){
					    case (0):
					    	if(this->zuan == Ty_1)
							if(sh == Byi){
								return 0;  
							}
							if(this->zuan != Ty_1)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (1):
							if(this->zuan == Ty_2)
							if(sh == Rui){
								return 0;  
							}
							if(this->zuan != Ty_2)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (2):
							if(this->zuan == Ty_3)
							if(sh == Dui){
								return 0;  
							}
							if(this->zuan != Ty_3)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						default:
						    break;	    	
					}  
				    return n_Port_setPai_New<1>(nNum, sh);
                case 2:
				    if (this->i_nLunSum%3 == (int)sh-1){
				        return n_Port_setPai_New<2>(nNum, sh);
					}
                case 3:
				    switch (this->i_nLunSum%3){
					    case (0):
					    	if(this->zuan == Ty_1)
							if(sh == Byi){
								return 0;  
							}
							if(this->zuan != Ty_1)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (1):
							if(this->zuan == Ty_2)
							if(sh == Rui){
								return 0;  
							}
							if(this->zuan != Ty_2)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (2):
							if(this->zuan == Ty_3)
							if(sh == Dui){
								return 0;  
							}
							if(this->zuan != Ty_3)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						default:
						    break;	    	
					}
					return n_Port_setPai_New<3>(nNum, sh);
                case 4:
				    if (this->i_nLunSum%3 == (int)sh-1){
					    return n_Port_setPai_New<4>(nNum, sh);
					}
                case 5:
				    switch (this->i_nLunSum%3){
					    case (0):
					    	if(this->zuan == Ty_1)
							if(sh == Byi){
								return 0;  
							}
							if(this->zuan != Ty_1)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (1):
							if(this->zuan == Ty_2)
							if(sh == Rui){
								return 0;  
							}
							if(this->zuan != Ty_2)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						case (2):
							if(this->zuan == Ty_3)
							if(sh == Dui){
								return 0;  
							}
							if(this->zuan != Ty_3)
							if(sh != (s_Har)this->zuan){
								return 0;  
							}
						    break;
						default:
						    break;	    	
					}  
					return n_Port_setPai_New<5>(nNum, sh);
                case 7:
				    if (this->i_nLunSum%3 == (int)sh-1){
					    return n_Port_setPai_New<7>(nNum, sh);
					}
                // 补充其他需要支持的N值
                default: 
                    // 处理不支持的N（如报错或返回默认值）
                    return 0; 
            }
            return 0;
        }
        
        dmod_Style get_isZX_style(){
		    dmod_Style d_sty = sty;	
        	return d_sty; 
		}
		//void i_NPro_Sert(int num, s_Har sh);
		template<unsigned int N>
        int n_Port_setPai_New(int nNum[N],s_Har sh){
            int i_NPro = 0;
			z_xPor_list *zpl = NULL, *dl;
			switch (this->i_nLunSum%3){
			    case (0):
				    // 修正：直接传递int数组nNum，无需包装为n_Soupai_kz
				    //i_NPro = zhi_Ye__(this->nHero_one->n_jHero_Get()).get_nPoker(this->nHero_one->template get_nChu_pai<N>(nNum));
                    //i_NPro = zhi_Ye__(this->nHero_one->template get_nChu_pai<N>(nNum));
                    i_NPro = zhi_Ye__<typename t1::HeroType>(this->nHero_one->n_jHero_Get())
                        .get_nPoker(*(this->nHero_one->template get_nChu_pai<N>(nNum)));
                    
                    //b_zTai_lis.nPort_chormNow_Sayler();
                    //if(nHero_one->nM_nCorLiper > 0)nHero_one->nM_nCorLiper -= 1;
                    if (nHero_one->nM_nCorLiper > 1)is_New[0] = true;
                    if (N == 4)nHero_one->nM_nCorLiper += 1,is_New[0] = true;
                    if ((this->dm_sty == _nZuam_xian___ && this->zuan == (zUang_Jia)Byi) || this->dm_sty == _n_HunZhan__) 
                    if (lr_jZhou_jsdeng){
                    	//  i_Cor_XIeFUn(s_Har sh,int n)
                    	//zpl = new z_xPor_list
                    	zpl = this->get_jZhou_jsXop();
                    	while(zpl!=NULL){
                    		i_NPro_Sert(zpl->z_xopor->get_nMum(),Rui);
							i_NPro_Sert(zpl->z_xopor->get_nMum(),Dui);
							zpl->z_xopor->set_nMumHuih(zpl->z_xopor->get_nMumHuih()-1);
							if(zpl->z_xopor->get_nMumHuih()==0){
								dl = zpl;
								delete dl; 
							}
						}
						lr_jZhou_jsdeng = false;
                    	
						return 0;	
			        }
					break;
                case (1):
                    // 同理修正参数传递
				    //i_NPro = zhi_Ye__(this->nHero_two->n_jHero_Get()).get_nPoker(this->nHero_two->template get_nChu_pai<N>(nNum));
				    //i_NPro = zhi_Ye__(this->nHero_two->template get_nChu_pai<N>(nNum));
				    i_NPro = zhi_Ye__<typename t2::HeroType>(this->nHero_two->n_jHero_Get())
                        .get_nPoker(*(this->nHero_two->template get_nChu_pai<N>(nNum)));
                    
                    //r_zTai_lis.nPort_chormNow_Sayler();
					//if(nHero_two->nM_nCorLiper > 0)nHero_two->nM_nCorLiper -= 1;
                    if (nHero_two->nM_nCorLiper > 1)is_New[1] = true;
                    if (N == 4)nHero_two->nM_nCorLiper += 1,is_New[1] = true;
                    if ((this->dm_sty == _nZuam_xian___ && this->zuan == (zUang_Jia)Rui) || this->dm_sty == _n_HunZhan__) 
                    if (lr_jZhou_jsdeng){
                    	//  i_Cor_XIeFUn(s_Har sh,int n)
                    	zpl = this->get_jZhou_jsXop();
                    	while(zpl!=NULL){
                    		i_NPro_Sert(zpl->z_xopor->get_nMum(),Byi);
							i_NPro_Sert(zpl->z_xopor->get_nMum(),Dui);
							zpl->z_xopor->set_nMumHuih(zpl->z_xopor->get_nMumHuih()-1);
							if(zpl->z_xopor->get_nMumHuih()==0){
								dl = zpl;
								delete dl; 
							}
						}
						lr_jZhou_jsdeng = false;
                    	
						return 0;	
			        }
					break;
                case (2):
			        // 同理修正参数传递
				    //i_NPro = zhi_Ye__(this->nHero_three->n_jHero_Get()).get_nPoker(this->nHero_three->template get_nChu_pai<N>(nNum));
				    //i_NPro = zhi_Ye__(this->nHero_three->template get_nChu_pai<N>(nNum));
					i_NPro = zhi_Ye__<typename t3::HeroType>(this->nHero_three->n_jHero_Get())
                        .get_nPoker(*(this->nHero_three->template get_nChu_pai<N>(nNum)));
					
					//if(nHero_three->nM_nCorLiper > 0)nHero_three->nM_nCorLiper -= 1;
					//d_zTai_lis.nPort_chormNow_Sayler();
					if (nHero_three->nM_nCorLiper > 1)is_New[2] = true;
					if (N == 4)nHero_three->nM_nCorLiper += 1,is_New[2] = true;
					if ((this->dm_sty == _nZuam_xian___ && this->zuan == (zUang_Jia)Dui) || this->dm_sty == _n_HunZhan__) 
                    if (lr_jZhou_jsdeng){
                    	//  i_Cor_XIeFUn(s_Har sh,int n)
                    	zpl = this->get_jZhou_jsXop();
                    	while(zpl!=NULL){
                    		i_NPro_Sert(zpl->z_xopor->get_nMum(),Byi);
							i_NPro_Sert(zpl->z_xopor->get_nMum(),Rui);
							zpl->z_xopor->set_nMumHuih(zpl->z_xopor->get_nMumHuih()-1);
							if(zpl->z_xopor->get_nMumHuih()==0){
								dl = zpl;
								delete dl; 
							}
						}
						lr_jZhou_jsdeng = false;
                    	
						return 0;	
			        }
					break;
		 	    default:
                    break;
			}
			
            i_NPro_Sert(i_NPro, sh);
        
		    return 0; // 补充返回值（原代码缺失）
		}
		
		//  enum oPor_ry {
		//	  m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
		//	  m_XinSr, m_CumLyior                //现杀, 存流 
		//  };
		
		z_xPor_list* get_jZhou_jsXop(){  //禁咒验证； 
			int nMzy = this->i_nLunSum%3;
			z_xPor_list *zpl = NULL, *dl;
			switch (nMzy){
				case (0):
					zpl = b_zTai_lis.get_lisTop_ptr();
					dl = zpl;
					while(dl != NULL){
						if(dl->z_xopor->get_mRuanying() == m_XinSr && dl->z_xopor->get_nMumHuih()==4)return dl;
						else dl = dl->ptr_next;
					}
					break;
				case (1):
					zpl = r_zTai_lis.get_lisTop_ptr();
					dl = zpl;
					while(dl != NULL){
						if(dl->z_xopor->get_mRuanying() == m_XinSr && dl->z_xopor->get_nMumHuih()==4)return dl;
						else dl = dl->ptr_next;
					}
					break;
				case (2):
					zpl = d_zTai_lis.get_lisTop_ptr();
					dl = zpl;
					while(dl != NULL){
						if(dl->z_xopor->get_mRuanying() == m_XinSr && dl->z_xopor->get_nMumHuih()==4)return dl;
						else dl = dl->ptr_next;
					}
					break;
				default:
					break;
			}
			return NULL;
		}
		
		//template<oPor_ry _ry__>   m_Jinz, m_Wuyr
		z_xPor_list* get_nPor_ry(oPor_ry _ry__){    //一般为查看，是否是特殊状况<>禁止攻击 m_Jinz，或不能行动 m_Wuyr 
			int nMzy = this->i_nLunSum%3;
			z_xPor_list *zpl = NULL, *dl;
			
			switch(nMzy) {
				case (0):
					zpl = b_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						if(_ry__ == dl->z_xopor->get_mRuanying())return dl;
						else dl = dl->ptr_next;
					}
					break;
				case (1):
					zpl = r_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						if(_ry__ == dl->z_xopor->get_mRuanying())return dl;
						else dl = dl->ptr_next;
					}
					break;
				case (2):
					zpl = d_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						if(_ry__ == dl->z_xopor->get_mRuanying())return dl;
						else dl = dl->ptr_next;
					}
					break;
				default:
					break;
			}
			return NULL; 
		} 
		
			
		zUang_Jia get_zUang_Jia(){
			return this->zuan;
		} 
		
		bool get_isZhuang_jia(){
			zUang_Jia j = this->get_zUang_Jia();
			switch(j) {
				case (Ty_1):
					if(this->i_nLunSum%3 == 0)return true;
					break;
				case (Ty_2):
					if(this->i_nLunSum%3 == 1)return true;
					break;
				case (Ty_3):
					if(this->i_nLunSum%3 == 2)return true;
					break;
				default:
				    break; 
			}
			return false;
		} 
		
		//  zTai_list<Byi> b_zTai_lis;
		//  zTai_list<Rui> r_zTai_lis;
		//  zTai_list<Dui> d_zTai_lis;

		z_xPor_list * i_Get_Port(s_Har sh){  // 获取格挡； 
			z_xPor_list *zpl = NULL, *dl;
			switch (sh){
				case (Byi):
					zpl = b_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						oPor_xl xl = dl->z_xopor->get_eZtlx();
						oPor_ry ry = dl->z_xopor->get_mRuanying();
						//  if()
						//nFanYu + m_XinSr = 格挡；
						if(xl == nFanYu && ry == m_XinSr)return dl;
						else dl = dl->ptr_next; 
					}
					break;
				case (Rui):
					zpl = r_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						oPor_xl xl = dl->z_xopor->get_eZtlx();
						oPor_ry ry = dl->z_xopor->get_mRuanying();
						//  if()
						//nFanYu + m_XinSr = 格挡；
						if(xl == nFanYu && ry == m_XinSr)return dl;
						else dl = dl->ptr_next; 
					}
					break;
				case (Dui):
					zpl = d_zTai_lis.get_lisTop_ptr();
					dl = zpl;
				    while(dl != NULL){
						oPor_xl xl = dl->z_xopor->get_eZtlx();
						oPor_ry ry = dl->z_xopor->get_mRuanying();
						//  if()
						//nFanYu + m_XinSr = 格挡；
						if(xl == nFanYu && ry == m_XinSr)return dl;
						else dl = dl->ptr_next; 
					}
					break;
				default:
					break;
			} 
			return NULL;
		} 
        //  sHar_inDer<Byi> b_Har1_jZhong = {0,0,0};
        //  sHar_inDer<Rui> r_Har1_jZhong = {0,0,0};
        //  sHar_inDer<Dui> d_Har1_jZhong = {0,0,0};
        int i_Cor_XIeFUn(s_Har sh,int n){     //执行血量盖度；<就是扣血> 
        	int xl=0;
        	switch (sh){
        		case (Byi):
        			//int m_Xie_n;         //血量 
        			xl = nHero_one->m_Xie_n -= n;
        			if(nHero_one->m_Xie_n<=0)delete nHero_one,xl=0;
        			nHero_one = NULL;
        			break;
        		case (Rui):
        			xl = nHero_two->m_Xie_n -= n;
        			if(nHero_two->m_Xie_n<=0)delete nHero_two,xl=0;
        			nHero_two = NULL;
        			break;
        		case (Dui):
        			nHero_three->m_Xie_n -= n;
        			if(nHero_three->m_Xie_n<=0)delete nHero_three,xl=0;
        			nHero_three = NULL;
        			break;
        		default:
        			break;
			}
			return xl;
		}
		/*
		bool n_Spro_PDShenfu(s_Har sh){
			switch (this->zuan){
				case (Ty_1):
					if (nHero_one==NULL)
					if (sh == this->zuan)return false;
					else {
						if (nHero_two==NULL && nHero_three==NULL)return true;
					} 
					break;
				case (Ty_2):
					if (nHero_two==NULL)
					if (sh == this->zuan)return false;
					else {
						if (nHero_three==NULL && nHero_one==NULL)return true;
					}
					break;
				case (Ty_3):
					if (nHero_three==NULL)
					if (sh == this->zuan)return false;
					else {
						if (nHero_two==NULL && nHero_one==NULL)return true;
					}
					break;
				case (w_Wurr):
					switch (sh){
						case (Byi):
							if(nHero_one==NULL)return false;
							break;
						case (Rui):
							if(nHero_two==NULL)return false;
							break;
						case (Dui):
							if(nHero_three==NULL)return false;
							break;
						default:
							break;
					} 
				    break; 
				default:
					break;
			}
			return true;
		}
        */
        bool i_xPro_livNow(){    //判断目前单位是否存活； 是给外部调用制定行动决方的。。。。。。。。 
            unsigned int i = this->i_nLunSum%3;
        	switch (i){
        		case (0):
        			if(nHero_one == NULL)return false;
        			break;
        		case (1):
        			if(nHero_two == NULL)return false;
        			break;
        		case (2):
        			if(nHero_three == NULL)return false;
        			break;
        		default:
        			break;
			}
			return true;
		} 
		 
		int i_NPro_Sert(int n, s_Har sh){
			int num = this->i_nLunSum%3;
			z_xPor_list * nfanyu_ztai,* dl;
			
			if(n == 0) return 0; 
			switch (num){
				// 不能自己攻击自己；
				// if(sh == this->nHero_one->n_jHero_Get().get_sHar())return 0; 
			    case (0):
			    	if(nHero_one->nM_nCorLiper > 0)is_New[0] = false;
			    	if(sh == this->nHero_one->n_jHero_Get().get_sHar())return 0;
					nfanyu_ztai = this->i_Get_Port(sh);
					if(nfanyu_ztai){
						//  z_XuLie_oPor
						//z_XuLie_oPor.
						n = n - nfanyu_ztai->z_xopor->get_nMum();
						if(n <= 0)nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
						if(n > 0)n = i_Cor_XIeFUn(sh,n),nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
					    //z_xPor_list. 
						if(nfanyu_ztai->z_xopor->get_nMumHuih() <= 0){
							dl = nfanyu_ztai;
						    delete dl;	
						}
						if(nHero_one==NULL)return 0;
					}
					else n = i_Cor_XIeFUn(sh,n);
					break;
				case (1):
			    	if(nHero_two->nM_nCorLiper > 0)is_New[1] = false;
			    	if(sh == this->nHero_two->n_jHero_Get().get_sHar())return 0;
					nfanyu_ztai = this->i_Get_Port(sh);
					if(nfanyu_ztai){
						//  z_XuLie_oPor
						//z_XuLie_oPor.
						n = n - nfanyu_ztai->z_xopor->get_nMum();
						if(n <= 0)nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
						if(n > 0)n = i_Cor_XIeFUn(sh,n),nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
					    //z_xPor_list. 
						if(nfanyu_ztai->z_xopor->get_nMumHuih() <= 0){
							dl = nfanyu_ztai;
						    delete dl;	
						}
						if(nHero_one==NULL)return 0;
					}
					else n = i_Cor_XIeFUn(sh,n);
					break;
				case (2):
			    	if(nHero_three->nM_nCorLiper > 0)is_New[2] = false;
			    	if(sh == this->nHero_three->n_jHero_Get().get_sHar())return 0;
					nfanyu_ztai = this->i_Get_Port(sh);
					if(nfanyu_ztai){     // 如果受攻击方有防御护盾; 
						//  z_XuLie_oPor
						//z_XuLie_oPor.
						n = n - nfanyu_ztai->z_xopor->get_nMum();
						if(n <= 0)nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
						if(n > 0)n = i_Cor_XIeFUn(sh,n),nfanyu_ztai->z_xopor->set_nMumHuih(nfanyu_ztai->z_xopor->get_nMumHuih()-1);
					    //z_xPor_list. 
						if(nfanyu_ztai->z_xopor->get_nMumHuih() <= 0){
							dl = nfanyu_ztai;
						    delete dl;	
						}
						if(nHero_one==NULL)return 0;
					}
					else n = i_Cor_XIeFUn(sh,n); // 没有护盾，直接扣血; 
					break;
				default:
					break;
		    }
		    return n;
			/*
		    switch (this->i_nLunSum%3){
				case (0):
					if(nHero_one->nM_nCorLiper > 0){
						//ByiRD_UpDate(this->nHero_one->n_jHero_Get().get_sHar()); 
						nHero_one->nM_nCorLiper -= 1;
					}
				    break; 
				case (1):
					if(nHero_two->nM_nCorLiper > 0){
						//ByiRD_UpDate(this->nHero_two->n_jHero_Get().get_sHar()); 
						nHero_two->nM_nCorLiper -= 1;
					}
				    break;
				case (2):
					if(nHero_three->nM_nCorLiper > 0){
						//ByiRD_UpDate(this->nHero_three->n_jHero_Get().get_sHar()); 
						nHero_three->nM_nCorLiper -= 1;
					}
				    break;
				default:
					break;
			}
			*/ 
		}
		
		/*
		unsigned int next_Poker_pHar(){
			if (this->i_nLunSum%3 == 0)this->n_iHuihe_sum += 1; 
			this->i_nLunSum += 1;
			return this->n_iHuihe_sum;
		} 
		*/
		//  n_YuanZhou*  
		
		n_YuanZhuo_base* next_Poker_pHar(){
			if (this->i_nLunSum%3 == 0){
			    this->n_iHuihe_sum += 1;
			} 
			 switch (this->i_nLunSum%3){
				case (0):
			        this->i_nLunSum += 1;
			        // nhero_oopjob.get_sPai_Num()
					if(nHero_one != NULL){
                        if(nHero_one->get_sPai_Num() <= 0){
                            delete nHero_one; // 补充：避免内存泄漏
                            nHero_one = NULL;
                        }
                    }
                    if(nHero_one == NULL)return this; 
					b_zTai_lis.iPoir_Next();
					if(nHero_one->nM_nCorLiper == 0){
						ByiRD_UpDate(this->nHero_one->n_jHero_Get().get_sHar()); 
					}
					if(nHero_one->nM_nCorLiper > 0){
					    //nHero_one->nM_nCorLiper -= 1;
					    if(is_New[0] == false)nHero_one->nM_nCorLiper -= 1; 
				    }
				    jZhong_UpDate(Byi); 
				    break; 
				case (1):
			        this->i_nLunSum += 1;
					if(nHero_two != NULL){
                        if(nHero_two->get_sPai_Num() <= 0){
                            delete nHero_two; // 补充：避免内存泄漏
                            nHero_two = NULL;
                        }
                    }
                    if(nHero_two == NULL)return this;
					r_zTai_lis.iPoir_Next();
					if(nHero_two->nM_nCorLiper == 0){
						ByiRD_UpDate(this->nHero_two->n_jHero_Get().get_sHar()); 
					}
				    if(nHero_two->nM_nCorLiper > 0){
					    //nHero_two->nM_nCorLiper -= 1;
					    if(is_New[1] == false)nHero_two->nM_nCorLiper -= 1;
				    }
				    jZhong_UpDate(Rui);
				    break;
				case (2):
			        this->i_nLunSum += 1;
					if(nHero_three != NULL){
                        if(nHero_three->get_sPai_Num() <= 0){
                            delete nHero_three; // 补充：避免内存泄漏
                            nHero_three = NULL;
                        }
                    }
                    if(nHero_three == NULL)return this;
					d_zTai_lis.iPoir_Next();
					if(nHero_three->nM_nCorLiper == 0){
						ByiRD_UpDate(this->nHero_three->n_jHero_Get().get_sHar()); 
					}
				    if(nHero_three->nM_nCorLiper > 0){
					    //nHero_three->nM_nCorLiper -= 1;
					    if(is_New[2] == false)nHero_three->nM_nCorLiper -= 1;
				    }
				    jZhong_UpDate(Dui);
				    break;
				default:
			        this->i_nLunSum += 1;
					break;
			}
			
			return this;
		} 
		
		unsigned int get_nwHero_PyiLiang(){
			unsigned int i_R = 0;
			int i = this->i_nLunSum%3;
			switch (i){
				case (0):
					// get_sPai_Num()
					i_R = this->nHero_one->get_sPai_Num();
					break;
				case (1):
					i_R = this->nHero_two->get_sPai_Num();
					break;
				case (2):
					i_R = this->nHero_three->get_sPai_Num();
					break;
				default:
					break;
			}
			return i_R;
		}
		
		~n_YuanZhuo(){
			if (nHero_one!=NULL)delete nHero_one;
			if (nHero_two!=NULL)delete nHero_two;
			if (nHero_three!=NULL)delete nHero_three;
		}
		
};


//// 辅助结构体：通用版本
//template<typename t_Tyir, int n>
//struct get_nPoker_impl {
//    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<n> zvr) {
//    	//  vector<int> v_tor = obj._zhiYeir__.get_HeroNliyr();
//        return n; // 通用实现
//    }
//};

template<typename t_Tyir>
int v_nSum_Summeng(int r,int y,vector<k_nKar> xs,s_Har sh,const zhi_Ye__<t_Tyir>& obj,int n_ps);

// 辅助结构体：特化n=1的情况
template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 1> {
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<1> zvr) {
    	vector<int> v_tor = obj.get_zhiYeir__().get_HeroNliyr();
    	int nN = zvr.get_nSum(),v_nSum = 0;
		vector<k_nKar> v_kar = zvr.get_Soupai_kz();
		int k1_r = 0, k2_y = 0;
		vector<k_nKar> v_Xs;
		 
		for (int i=0;i<nN;i++){
			k_nKar xs = v_kar[i];
			v_Xs.push_back(xs);
			v_nSum += (int)v_kar[i].get_kz();
		}
		int k;
		k2_y = v_nSum / 10;
		k1_r = v_nSum % 10;
		int j = 0;
		v_nSum_Summeng<t_Tyir>(k1_r,k2_y,v_Xs,obj.get_zhiYeir__().get_sHar(),obj,1);
		
		j = obj.get_zhiYeir__().get_sHar();
		switch (j){    //	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
			case (Byi):
				b_zTai_lis.nPort_chormNow_Sayler();
				b_zTai_lis.nPort_chormNow_Sayler_mYing(); 
				k = b_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			case (Rui):
				r_zTai_lis.nPort_chormNow_Sayler();
				r_zTai_lis.nPort_chormNow_Sayler_mYing();
				k = r_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			case (Dui):
				d_zTai_lis.nPort_chormNow_Sayler();
				d_zTai_lis.nPort_chormNow_Sayler_mYing();
				k = d_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			default:
    			printf("数据出现错误;");
    			exit(0);
		}
		
        return v_tor[0] + k; // n=1的特定实现
    }
};

// 特化n=2的情况
template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 2> {
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<2> zvr) {
    	vector<int> v_tor = obj.get_zhiYeir__().get_HeroNliyr();
    	int nN = zvr.get_nSum(),v_nSum = 0;
		vector<k_nKar> v_kar = zvr.get_Soupai_kz();
		int k1_r = 0, k2_y = 0;
		vector<k_nKar> v_Xs;
		 
		for (int i=0;i<nN;i++){
			k_nKar xs = v_kar[i];
			v_Xs.push_back(xs);
			v_nSum += (int)v_kar[i].get_kz();
		}
		int k_g,k_f,k_nd;
		k2_y = v_nSum / 10;
		k1_r = v_nSum % 10;
		int j = 0;
		
		v_nSum_Summeng<t_Tyir>(k1_r,k2_y,v_Xs,obj.get_zhiYeir__().get_sHar(),obj,1);
		j = obj.get_zhiYeir__().get_sHar();
		switch (j){    //	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
			case (Byi):
				b_zTai_lis.nPort_chormNow_Sayler_mYing();
				b_zTai_lis.nPort_chormNow_Sayler();
				k_g = b_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = b_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = b_zTai_lis.get_chorimNow_Game(nNenDng);
				b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,(v_tor[1]+k_f)+(v_tor[2]+k_nd),2,m_XinSr))); //nFanYu + m_XinSr = 格挡； 
				break;
			case (Rui):
				r_zTai_lis.nPort_chormNow_Sayler_mYing();
				r_zTai_lis.nPort_chormNow_Sayler();
				k_g = r_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = r_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = r_zTai_lis.get_chorimNow_Game(nNenDng);
				r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,(v_tor[1]+k_f)+(v_tor[2]+k_nd),2,m_XinSr))); //nFanYu + m_XinSr = 格挡；
				break;
			case (Dui):
				d_zTai_lis.nPort_chormNow_Sayler_mYing();
				d_zTai_lis.nPort_chormNow_Sayler();
				k_g = d_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = d_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = d_zTai_lis.get_chorimNow_Game(nNenDng);
				d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,(v_tor[1]+k_f)+(v_tor[2]+k_nd),2,m_XinSr))); //nFanYu + m_XinSr = 格挡；
				break;
			default:
    			printf("数据出现错误;");
    			exit(0);
		} 
		
		return 0; // (v_tor[1]+k_f)+(v_tor[2]+k_nd);  n=2的特定实现
    }
};

// 继续特化其他n值（n=3,4,5,7）
template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 3> {
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<3> zvr) {
    	vector<int> v_tor = obj.get_zhiYeir__().get_HeroNliyr();
    	int nN = zvr.get_nSum(),v_nSum = 0;
		vector<k_nKar> v_kar = zvr.get_Soupai_kz();
		int k1_r = 0, k2_y = 0;
		vector<k_nKar> v_Xs; 
		
		for (int i=0;i<nN;i++){
			k_nKar xs = v_kar[i];
			v_Xs.push_back(xs);
			v_nSum += (int)v_kar[i].get_kz();
		}
		int k;
		k2_y = v_nSum / 10;
		k1_r = v_nSum % 10;
		int j = 0;
		
		v_nSum_Summeng<t_Tyir>(k1_r,k2_y,v_Xs,obj.get_zhiYeir__().get_sHar(),obj,1);
		j = obj.get_zhiYeir__().get_sHar();
		switch (j){    //	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
			case (Byi):
				b_zTai_lis.nPort_chormNow_Sayler_mYing();
				b_zTai_lis.nPort_chormNow_Sayler();
				k = b_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			case (Rui):
				r_zTai_lis.nPort_chormNow_Sayler_mYing();
				r_zTai_lis.nPort_chormNow_Sayler();
				k = r_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			case (Dui):
				d_zTai_lis.nPort_chormNow_Sayler_mYing();
				d_zTai_lis.nPort_chormNow_Sayler();
				k = d_zTai_lis.get_chorimNow_Game(nGongJ);
				break;
			default:
    			printf("数据出现错误;");
    			exit(0);
		}
		
        return v_tor[0] + k + 1;
    }
};

template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 4> {
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<4> zvr) {
    	vector<int> v_tor = obj.get_zhiYeir__().get_HeroNliyr();
    	const string obt_sh = obj.get_zhiYeir__().get_extra_hero();
    	
    	int nN = zvr.get_nSum(),v_nSum = 0;
		vector<k_nKar> v_kar = zvr.get_Soupai_kz();
		int k1_r = 0, k2_y = 0;
		vector<k_nKar> v_Xs; 
		for (int i=0;i<nN;i++){
			k_nKar xs = v_kar[i];
			v_Xs.push_back(xs);
			v_nSum += (int)v_kar[i].get_kz();
		}
		int k_g,k_f,k_nd;
		k2_y = v_nSum / 10;
		k1_r = v_nSum % 10;
		int j = 0;
		
		v_nSum_Summeng<t_Tyir>(k1_r,k2_y,v_Xs,obj.get_zhiYeir__().get_sHar(),obj,1);
		j = obj.get_zhiYeir__().get_sHar();
		switch (j){    //	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
			case (Byi):
				b_zTai_lis.nPort_chormNow_Sayler();
				b_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = b_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = b_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = b_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			case (Rui):
				r_zTai_lis.nPort_chormNow_Sayler();
				r_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = r_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = r_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = r_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			case (Dui):
				d_zTai_lis.nPort_chormNow_Sayler();
				d_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = d_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = d_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = d_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			default:
    			printf("数据出现错误;");
    			break; 
		} 
		
    	if(obt_sh == "骑士"){
    		obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar())
			{
    			case (Byi):
    				b_Har.ndOng += (v_tor[0]+k_g) + k_nd;
    				break;
    			case (Rui):
    				r_Har.ndOng += (v_tor[0]+k_g) + k_nd;
    				break;
    			case (Dui):
    				d_Har.ndOng += (v_tor[0]+k_g) + k_nd; 
    				break;
    			default:
    				printf("数据出现错误;");
    				break; 
			}
		} 
    	if(obt_sh == "战士"){
    		obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar()){
    			case (Byi):
    				b_Har.gGong += (v_tor[2]+k_nd) + k_g;
    				break;
    			case (Rui):
    				r_Har.gGong += (v_tor[2]+k_nd) + k_g;
    				break;
    			case (Dui):
    				d_Har.gGong += (v_tor[2]+k_nd) + k_g; 
    				break;
    			default:
    				printf("数据出现错误;");
    				break; 
			}
		}
		
		
		// Vvv....
		if(obt_sh == "盾卫"){
			obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar()){
    			case (Byi):
    				b_Har.fFag = (b_Har.fFag + v_tor[1])*2 - v_tor[1] + k_f;
    				break;
    			case (Rui):
    				r_Har.fFag = (r_Har.fFag + v_tor[1])*2 - v_tor[1] + k_f;
    				break;
    			case (Dui):
    				d_Har.fFag = (d_Har.fFag + v_tor[1])*2 - v_tor[1] + k_f;
    				break;
    			default:
    				printf("数据出现错误;");
    				break; 
			}
		}
        
		return 0;
    }
    
};

// 在实现文件（如pk_hero_system.cpp）中添加
//template int v_nSum_Summeng<z_Yryer<3, 2, 1>>(int, int, std::vector<x_sHurruir>, s_Har, const zhi_Ye__<z_Yryer<3, 2, 1>>&, int);
//template int v_nSum_Summeng<z_Yryer<3, 1, 2>>(int, int, std::vector<x_sHurruir>, s_Har, const zhi_Ye__<z_Yryer<3, 1, 2>>&, int);
//template int v_nSum_Summeng<z_Yryer<2, 3, 1>>(int, int, std::vector<x_sHurruir>, s_Har, const zhi_Ye__<z_Yryer<2, 3, 1>>&, int);
// 其他需要的实例化...

template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 5> {
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<5> zvr) {
    	vector<int> v_tor = obj.get_zhiYeir__().get_HeroNliyr();
    	const string obt_sh = obj.get_zhiYeir__().get_extra_hero();
    	
    	int nN = zvr.get_nSum(),v_nSum = 0;
		vector<k_nKar> v_kar = zvr.get_Soupai_kz();
		int k1_r = 0, k2_y = 0;
		vector<k_nKar> v_Xs; 
		for (int i=0;i<nN;i++){
			k_nKar xs = v_kar[i];
			v_Xs.push_back(xs);
			v_nSum += (int)v_kar[i].get_kz();
		}
		int k_g,k_f,k_nd;
		k2_y = v_nSum / 10;
		k1_r = v_nSum % 10;
		int j = 0;
		
		v_nSum_Summeng<t_Tyir>(k1_r,k2_y,v_Xs,obj.get_zhiYeir__().get_sHar(),obj,1);
		j = obj.get_zhiYeir__().get_sHar();
		switch (j){    //	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
			case (Byi): 
				b_zTai_lis.nPort_chormNow_Sayler();
				b_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = b_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = b_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = b_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			case (Rui):
				r_zTai_lis.nPort_chormNow_Sayler();
				r_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = r_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = r_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = r_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			case (Dui):
				d_zTai_lis.nPort_chormNow_Sayler();
				d_zTai_lis.nPort_chormNow_Sayler_mYing();
				k_g = d_zTai_lis.get_chorimNow_Game(nGongJ);
				k_f = d_zTai_lis.get_chorimNow_Game(nFanYu);
				k_nd = d_zTai_lis.get_chorimNow_Game(nNenDng);
				break;
			default:
    			printf("数据出现错误;");
    			exit(0);
		} 
		
    	if(obt_sh == "骑士"){
    		obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar())
			{
    			case (Byi):
    				return b_Har.ndOng + (v_tor[2] + k_nd) + b_Har.fFag + (v_tor[1] + k_f);
    				break;
    			case (Rui):
    				return r_Har.ndOng + (v_tor[2] + k_nd) + r_Har.fFag + (v_tor[1] + k_f);
    				break;
    			case (Dui):
    				return d_Har.ndOng + (v_tor[2] + k_nd) + d_Har.fFag + (v_tor[1] + k_f); 
    				break;
    			default:
    				printf("数据出现错误;");
    				exit(0);
			}
    		return 1;
		} 
    	if(obt_sh == "战士"){
    		obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar()){
    			case (Byi):
    				return b_Har.gGong + (v_tor[0] + k_g) + b_Har.ndOng + (v_tor[2] + k_nd);
    				break;
    			case (Rui):
				    return r_Har.gGong + (v_tor[0] + k_g) + r_Har.ndOng + (v_tor[2] + k_nd);
    				break;
    			case (Dui):
				    return d_Har.gGong + (v_tor[0] + k_g) + d_Har.ndOng + (v_tor[2] + k_nd);
    				break;
    			default:
    				printf("数据出现错误;");
    				exit(0);
			}
    		return 2;
		}
		if(obt_sh == "盾卫"){
			obj.get_zhiYeir__().get_sHar();
    		switch(obj.get_zhiYeir__().get_sHar()){
    			case (Byi):
    				return b_Har.fFag + v_tor[1] + k_f;
    				break;
    			case (Rui):
    				return r_Har.fFag + v_tor[1] + k_f;
    				break;
    			case (Dui):
    				return d_Har.fFag + v_tor[1] + k_f; 
    				break;
    			default:
    				printf("数据出现错误;");
    				exit(0);
			}
    		return 3;
		}
        return 5;
    }
};


template<typename t_Tyir>
int v_nSum_Summeng(int r,int y,vector<k_nKar> xs,s_Har sh,const zhi_Ye__<t_Tyir>& obj,int n_ps){
	int r_Ra = 0,y_Yr = 0;
	bool bl_Yin = false,bl_Run = false;
	int i_Fk=0,i_Hx=0,e_Mh=0,e_Hk=0; 
	unsigned int n_Jm=0, m_Kn=0,k_Qg=0;
	// k_nKar.get_Px();
	//  k_nKar
	vector<k_nKar> x_sHrr = xs;
	if(r!=0){
		if(r%3==0) r_Ra=3;
	    else if(r%2==0) r_Ra=2;
	    else r_Ra=1;
	}
	    
	if(y!=0){
		if(y%3==0) y_Yr=3;
	    else if(y%2==0) y_Yr=2;
	    else y_Yr=1;
	}
	//    enum x_sHurruir {i_r='r',iFk='F',iHx='X',eMh='M',eHk='K',e_y='y'};
	vector<k_nKar>::iterator itr;
	for(itr=x_sHrr.begin();itr!=x_sHrr.end();++itr){
		switch(itr->get_Px()){
			case (iFk):
				i_Fk += 1;
				break;
			case (iHx):
				i_Hx += 1;
				break;
			case (eMh):
				e_Mh += 1;
				break;
			case (eHk):
				e_Hk += 1;
				break;
			default:
				if (itr->get_Px() == e_y){bl_Yin=true;}
				else if (itr->get_Px() == i_r){
					bl_Run = true;
				}
				else printf("数据有问题；");
				break; 
		}
		// unsigned int n_Jm=0, m_Kn=0,k_Qg=0;
		switch (itr->get_kz()){
			case (_J__):
				n_Jm += 1;
				break;
			case (_K__):
				m_Kn += 1;
				break;
			case (_Q__):
				k_Qg += 1;
				break;
			default:
				break;
		}
	}
	int n_byi = ((i_Hx < e_Mh)?i_Hx:e_Mh) + ((i_Fk < e_Hk)?i_Fk:e_Hk);
	int n_rui = i_Hx + i_Fk, n_dui = e_Mh + e_Hk; 
	    
	switch (sh) {
		case (Byi):
			if (bl_Yin){
				//	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
				//  m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
				//  m_XinSr, m_CumLyior                //现杀, 存流 
				switch (y_Yr){
					case (1):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi,0+1,m_Yimg)));
//				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,0,m_Ruam)));
						break;
					case (2):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
//				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,0,m_Ruam)));
						break;
					case (3):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}  
			} else if(bl_Run){
				switch (r_Ra){
					case (1):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
						break;
					case (2):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,0+1,m_Ruam)));
						break;
					case (3):
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,1+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,1+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,1+1,m_Ruam)));
				        b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}
			}else {
			    // unsigned int n_Jm=0, m_Kn=0,k_Qg=0;
				if(n_rui > 0){
					int k=0,j=0;
					if (m_Kn > 3)k = m_Kn-2,j = 1;
					else {
						k = m_Kn-1, j = 0;
					}
				    b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+j,0+1+k,m_Ruam)));
			    }
				
				if(n_dui > 0){
					int k=0,j=0;
					if (k_Qg > 3)k = k_Qg - 2,j = 1;
					else {
						k = k_Qg-1, j = 0;
					}
				    b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+k,0+1+j,m_Ruam)));
			    }
				
				if(n_byi > 0){
					int k=0,j=0;
					if (n_Jm > 3)k = n_Jm - 2,j = 1;
					else {
						k = n_Jm-1, j = 0;
					}
				    b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+k,0+1+j,m_Ruam)));
				}    
				b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,r_Ra-1,0+1,m_Ruam)));
			}
			break;
		case (Rui):
			if (bl_Yin){
				//	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
				//  m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
				//  m_XinSr, m_CumLyior                //现杀, 存流 
				switch (y_Yr){
					case (1):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi,0+1,m_Yimg)));
						break;
					case (2):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
						break;
					case (3):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}  
			} else if(bl_Run){
				switch (r_Ra){
					case (1):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
						break;
					case (2):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,0+1,m_Ruam)));
						break;
					case (3):
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,1+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,1+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,1+1,m_Ruam)));
				        r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}
			}else {
			// unsigned int n_Jm=0, m_Kn=0,k_Qg=0;
				if(n_rui > 0){
					int k=0,j=0;
					if (m_Kn > 3)k = m_Kn - 2,j = 1;
					else {
						k = m_Kn-1, j = 0;
					}
				    r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+j,0+1+k,m_Ruam)));
			    }
				
				if(n_dui > 0){
					int k=0,j=0;
					if (k_Qg > 3)k = k_Qg - 2,j = 1;
					else {
						k = k_Qg-1, j = 0;
					}
				    r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+k,0+1+j,m_Ruam)));
			    }
				
				if(n_byi > 0){
					int k=0,j=0;
					if (n_Jm > 3)k = n_Jm - 2,j = 1;
					else {
						k = n_Jm-1, j = 0;
					}
				    r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+k,0+1+j,m_Ruam)));
				}    
				r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,r_Ra-1,0+1,m_Ruam)));
			}
			break;
		case (Dui):
		    if (bl_Yin){
				//	nGongJ, nFanYu, nNenDng, nNull    //英雄的能力属性
				//  m_Ruam, m_Yimg, m_Jinz, m_Wuyr,    //软, 硬, 禁, 无
				//  m_XinSr, m_CumLyior                //现杀, 存流 
				switch (y_Yr){
					case (1):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi,0+1,m_Yimg)));
						break;
					case (2):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
						break;
					case (3):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Yimg)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}  
			} else if(bl_Run){
				switch (r_Ra){
					case (1):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
						break;
					case (2):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,0+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,0+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,0+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,0+1,m_Ruam)));
						break;
					case (3):
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+1,1+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+1,1+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+1,1+1,m_Ruam)));
				        d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,1,1+1,m_Ruam)));
						break;
					default:
					    printf("数据有问题；");
						break;
				}
			}else {
			// unsigned int n_Jm=0, m_Kn=0,k_Qg=0;
				if(n_rui > 0){
					int k=0,j=0;
					if (m_Kn > 3)k = m_Kn - 2,j = 1;
					else {
						k = m_Kn-1, j = 0;
					}
				    d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,n_rui+j,0+1+k,m_Ruam)));
			    }
				
				if(n_dui > 0){
					int k=0,j=0;
					if (k_Qg > 3)k = k_Qg - 2,j = 1;
					else {
						k = k_Qg-1, j = 0;
					}
				    d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nFanYu,n_dui+k,0+1+j,m_Ruam)));
			    }
				
				if(n_byi > 0){
					int k=0,j=0;
					if (n_Jm > 3)k = n_Jm - 2,j = 1;
					else {
						k = n_Jm-1, j = 0;
					}
				    d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNenDng,n_byi+k,0+1+j,m_Ruam)));
				}    
				d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,r_Ra-1,0+1,m_Ruam)));
			}
			break;
		default:
			printf("数据出现错误;");
    		exit(0);
	}
	return 1; 
}

template<typename t_Tyir>
struct get_nPoker_impl<t_Tyir, 7> {  // 禁咒; 
    static int calc(const zhi_Ye__<t_Tyir>& obj,n_Soupai_kz<7> zvr) {
    	// 现杀 + n_Mum_huih多回合 = 一顿连杀
		// n_Mum = 1;  n_Mum_huih = 4; 现杀，特攻<>群体攻击; 
		// lr_jZhou_jsdeng = true 禁咒警示标志;
		lr_jZhou_jsdeng = true; 
		obj.get_zhiYeir__().get_sHar();
    	switch(obj.get_zhiYeir__().get_sHar()){
    		case (Byi):
    			b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,1,4,m_XinSr)));
    			// 后效； 
    			b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,0,2,m_Jinz))); 
    			r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			break;
    		case (Rui):
    			r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,1,4,m_XinSr)));
    			// 后效；
    			r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,0,2,m_Jinz))); 
    			b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			break;
    		case (Dui):
    			d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,1,4,m_XinSr)));
    			// 后效；
    			d_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nGongJ,0,2,m_Jinz))); 
    			b_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			r_zTai_lis.set_puth(new z_xPor_list(new z_XuLie_oPor(nNull,0,1, m_Wuyr)));
    			break;
    		default:
    			printf("数据出现错误;");
    			exit(0);
		}
        return 7;
    }
};

#endif